<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Running</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/element-ui@2.13.2/lib/theme-chalk/index.css">
  <link rel="stylesheet" href="./form.css">
</head>

<body>
  <div id="app">
    <el-form ref="form" :model="form" label-width="80px">
      <el-form-item label="姓名">
        <el-input v-model="form.name"></el-input>
      </el-form-item>

      <el-button type="primary" @click="onSubmit">立即创建</el-button>
      </el-form-item>
    </el-form>
  </div>

  <script src="https://cdn.jsdelivr.net/npm/vue@2.6.12/dist/vue.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/element-ui@2.13.2/lib/index.js"></script>


  <script>
    new Vue({
      el: "#app",
      data() {
        return {
          form: {
            name: '',
          }
        }
      },
      methods: {
        onSubmit() {
          localStorage.setItem("running_name", this.form.name || "")
          window.location.href = "./result.html"
        }
      }
    })
  </script>
</body>

</html>